package com.b511.swpu.cementbackend.controller;

import com.b511.swpu.cementbackend.service.ValidateService;
import com.b511.swpu.cementbackend.util.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(value = "数据校验", tags = {"数据校验"})
@RestController
@RequestMapping("/validate")
public class ValidateController {

    private final ValidateService validateService;

    public ValidateController(ValidateService validateService) {
        this.validateService = validateService;
    }

    @PostMapping
    public R validate() {
        return validateService.validate();
    }

    @GetMapping("/borehole/error")
    public R getErrorBorehole() {
        return validateService.getErrorBorehole();
    }

    @GetMapping("/borehole/error/{boreholeId}")
    public R getErrorBoreholeById(@PathVariable Long boreholeId) {
        return validateService.getErrorBoreholeById(boreholeId);
    }

}
